

#ifndef UD_DBCFILERS_H
#define UD_DBCFILERS_H 1

#include "zdbfiler.h"
#pragma pack (push, 8)

class UcDbWblockCloneFiler;
class UcDbImpDeepCloneFiler;

class UcDbDeepCloneFiler: public UcDbDwgFiler
{
    friend class UcDbSystemInternals;
public:
    UCRX_DECLARE_MEMBERS(UcDbDeepCloneFiler);
    UcDbDeepCloneFiler();
    virtual ~UcDbDeepCloneFiler();

    virtual Ucad::ErrorStatus filerStatus() const;
    virtual UcDb::FilerType   filerType() const;
    virtual void              setFilerStatus(Ucad::ErrorStatus);
    virtual void              resetFilerStatus();

    virtual Ucad::ErrorStatus readHardOwnershipId(UcDbHardOwnershipId*);
    virtual Ucad::ErrorStatus writeHardOwnershipId(const UcDbHardOwnershipId&);

    virtual Ucad::ErrorStatus readSoftOwnershipId(UcDbSoftOwnershipId*);
    virtual Ucad::ErrorStatus writeSoftOwnershipId(const UcDbSoftOwnershipId&);

    virtual Ucad::ErrorStatus readHardPointerId(UcDbHardPointerId*);
    virtual Ucad::ErrorStatus writeHardPointerId(const UcDbHardPointerId&);

    virtual Ucad::ErrorStatus readSoftPointerId(UcDbSoftPointerId*);
    virtual Ucad::ErrorStatus writeSoftPointerId(const UcDbSoftPointerId&);

	virtual Ucad::ErrorStatus readInt8(ZSoft::Int8 *);
	virtual Ucad::ErrorStatus writeInt8(ZSoft::Int8 );

    virtual Ucad::ErrorStatus readString(ZTCHAR **);
    virtual Ucad::ErrorStatus writeString(const ZTCHAR *);

	virtual Ucad::ErrorStatus readString(UcString &);
	virtual Ucad::ErrorStatus writeString(const UcString &);

    virtual Ucad::ErrorStatus readBChunk(zds_binary*);
    virtual Ucad::ErrorStatus writeBChunk(const zds_binary&);

    virtual Ucad::ErrorStatus readUcDbHandle(UcDbHandle*);
    virtual Ucad::ErrorStatus writeUcDbHandle(const UcDbHandle&);

	virtual Ucad::ErrorStatus readInt64(ZSoft::Int64*);
	virtual Ucad::ErrorStatus writeInt64(ZSoft::Int64);

    virtual Ucad::ErrorStatus readInt32(ZSoft::Int32*);
    virtual Ucad::ErrorStatus writeInt32(ZSoft::Int32);

    virtual Ucad::ErrorStatus readInt16(ZSoft::Int16*);
    virtual Ucad::ErrorStatus writeInt16(ZSoft::Int16);

	virtual Ucad::ErrorStatus readUInt64(ZSoft::UInt64*);
	virtual Ucad::ErrorStatus writeUInt64(ZSoft::UInt64);

    virtual Ucad::ErrorStatus readUInt32(ZSoft::UInt32*);
    virtual Ucad::ErrorStatus writeUInt32(ZSoft::UInt32);

    virtual Ucad::ErrorStatus readUInt16(ZSoft::UInt16*);
    virtual Ucad::ErrorStatus writeUInt16(ZSoft::UInt16);

    virtual Ucad::ErrorStatus readUInt8(ZSoft::UInt8*);
    virtual Ucad::ErrorStatus writeUInt8(ZSoft::UInt8);

    virtual Ucad::ErrorStatus readBoolean(ZSoft::Boolean*);
    virtual Ucad::ErrorStatus writeBoolean(ZSoft::Boolean);

    virtual Ucad::ErrorStatus readBool(bool*);
    virtual Ucad::ErrorStatus writeBool(bool);

    virtual Ucad::ErrorStatus readDouble(double*);
    virtual Ucad::ErrorStatus writeDouble(double);

    virtual Ucad::ErrorStatus readPoint2d(UcGePoint2d*);
    virtual Ucad::ErrorStatus writePoint2d(const UcGePoint2d&);

    virtual Ucad::ErrorStatus readPoint3d(UcGePoint3d*);
    virtual Ucad::ErrorStatus writePoint3d(const UcGePoint3d&);

    virtual Ucad::ErrorStatus readVector2d(UcGeVector2d*);
    virtual Ucad::ErrorStatus writeVector2d(const UcGeVector2d&);

    virtual Ucad::ErrorStatus readVector3d(UcGeVector3d*);
    virtual Ucad::ErrorStatus writeVector3d(const UcGeVector3d&);

    virtual Ucad::ErrorStatus readScale3d(UcGeScale3d*);
    virtual Ucad::ErrorStatus writeScale3d(const UcGeScale3d&);

    virtual Ucad::ErrorStatus readBytes(void*, ZSoft::UIntPtr);
    virtual Ucad::ErrorStatus writeBytes(const void*, ZSoft::UIntPtr);

    virtual Ucad::ErrorStatus readAddress(void **);
    virtual Ucad::ErrorStatus writeAddress(const void *);

    virtual Ucad::ErrorStatus seek(ZSoft::Int64 offset, int method);
    virtual ZSoft::Int64      tell() const;

    virtual Ucad::ErrorStatus addReferences(UcDbIdRefQueue&);
    virtual              bool usesReferences() const;
    virtual UcDbFilerController& controller() const;

    virtual bool              getNextOwnedObject(UcDbObjectId& id);
    virtual bool              moreOwnedObjects() const;

protected:
    UcDbDeepCloneFiler(UcDbSystemInternals*);
private:
    UcDbImpDeepCloneFiler*      mpImpFiler;
};

class UcDbWblockCloneFiler: public  UcDbDeepCloneFiler
{
    friend class UcDbSystemInternals;
public:
    UCRX_DECLARE_MEMBERS(UcDbWblockCloneFiler);

    UcDbWblockCloneFiler();

    virtual Ucad::ErrorStatus addReferences(UcDbIdRefQueue&);
    virtual              bool usesReferences() const;

    virtual bool              getNextHardObject(UcDbObjectId& id);
    virtual bool              moreHardObjects() const;

    virtual UcDb::FilerType   filerType() const;
};

#pragma pack (pop)
#endif
